package com.wqr.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.wqr.dao.LogInfoDao;
import com.wqr.pojo.LogInfo;
import com.wqr.pojo.LogInfoExample;

@Service
public class LogInfoServiceImp implements LogInfoService {
	@Autowired
	public LogInfoDao logInfoDao;
	
	public List<LogInfo> list() throws Exception {
		LogInfoExample example = new LogInfoExample();
		List<LogInfo> list = logInfoDao.selectByExample(example);
		return list;
	}

	public int delectLogInfo(Integer logInfoId) throws Exception {
		int a = logInfoDao.deleteByPrimaryKey(logInfoId);
		if(a > 0) {
			return 1;
		}else {
			return 0;
		}
	}
	public int insertLogInfo(LogInfo logInfo) throws Exception {
		int a = logInfoDao.insertSelective(logInfo);
		if(a > 0) {
			return 1;
		}else {
			return 0;
		}
	}
	public int updateLogInfo(LogInfo logInfo) throws Exception {
		int a = logInfoDao.updateByPrimaryKey(logInfo);
		if(a > 0) {
			return 1;
		}else {
			return 0;
		}
	}

	public List<LogInfo> selectLogInfo(LogInfo logInfo) throws Exception {
		List<LogInfo> list = logInfoDao.selectByWhere(logInfo);
		return list;
	}

	public List<LogInfo> selectByPrimaryKey(Integer logInfoId) throws Exception {
		@SuppressWarnings("unchecked")
		List<LogInfo> list = (List<LogInfo>) logInfoDao.selectByPrimaryKey(logInfoId);
		return list;
	}
}
